; /*!/js/service/common.js*/
"use strict";
angular.module("yeying.web.service", []).service("WebCommonService", function() {
  var e = function(e) {
      try {
        var t = JSON.parse(e);
        return "object" == typeof t ? !0 : !1
      } catch (n) {
        return !1
      }
    },
    t = function(e, t) {
      var n = new RegExp("^" + t);
      return n.test(e)
    },
    n = function(e) {
      var t = new Date(e),
        n = new Date,
        r = t.getMinutes() < 10 ? "0" + t.getMinutes() : t.getMinutes(),
        u = t.getSeconds() < 10 ? "0" + t.getSeconds() : t.getSeconds(),
        i = t.getHours() + ":" + r + ":" + u;
      if (n.getDate() !== t.getDate()) {
        var g = t.getMonth() + 1 + "-" + t.getDate() + " " + i;
        return t.getFullYear() + "-" + g
      }
      return i
    },
    r = function(e) {
      return e && e.length > 6 && "[自动回复]" === e.substring(0, 6) ? !0 : !1
    };
  return {
    isJson: e,
    getDateShowStringByTime: n,
    isAutoReply: r,
    startWith: t
  }
});; /*!/js/service/sdk.js*/
"use strict";
angular.module("yeying.web.service").service("WebSdkService", ["WebManualService", "StateCenter", function(e, n) {
  var i = null,
    t = function(e, n, t) {
      var c = {
        pspJumpUrl: YeYing.config.ikefu.server + YeYing.config.ikefu.hiPspJumpUrl,
        to: YeYing.config.hiAcount,
        onReceivedMsg: e,
        onInitSuccess: n,
        onOffline: function() {
          t(YeYing.config.offlineMessage)
        },
        onKickOff: function() {
          t(YeYing.config.repeatLogin)
        }
      };
      YeYing.config.systemType === YeYing.SYSTEMTYPE.EXTERNAL && (c.ct = "v"), i = new Webchat(c), i.init()
    },
    c = function(t, c) {
      var s = t;
      YeYing.config.mode === YeYing.MODE.Manual && n.getState(YeYing.STATE_TYPE.MANUAL) === YeYing.MAN_STAT.NLP ? e.enterManual(function(e, n) {
        if ("success" !== e) {
          var t = {};
          t.result = "userMessage", t.content = s, c(t);
          var g = {};
          g.result = "noticeMessage", g.content = n.reason.replace(/offline:/g, ""), c(g)
        } else i.sendMsg(s, function(e) {
          c(e)
        })
      }) : i.sendMsg(s, function(e) {
        c(e)
      })
    },
    s = function(e, n) {
      i.sendImgMsg(e, function(e) {
        n(e)
      })
    },
    g = function(e, n) {
      i.sendEvent("click", e, function(e) {
        n(e)
      })
    };
  return {
    initWebChat: t,
    sendMsg: c,
    sendEvent: g,
    sendImgMsg: s
  }
}]);; /*!/js/service/manual.js*/
"use strict";
angular.module("yeying.web.service").service("WebManualService", ["$http", "StateCenter", function(e, n) {
  var i = function(e, n, i) {
      this.baiduAccount = e, this.type = i
    },
    t = null,
    s = function(s, c) {
      t = new i(s.self.name, s.self.avatar, 1), e({
        method: "JSONP",
        url: YeYing.config.ikefu.server + YeYing.config.ikefu.manual.status,
        params: {
          systemId: YeYing.config.systemId,
          callback: "JSON_CALLBACK",
          userHi: t.baiduAccount
        },
        timeout: 4e3
      }).success(function(e) {
        e && void 0 !== e.status && (YeYing.config.mode === YeYing.MODE.Manual && e.status === YeYing.MAN_STAT.NLP || n.setState(YeYing.STATE_TYPE.MANUAL, e.status), c())
      }).error(function() {
        n.setState(YeYing.STATE_TYPE.MANUAL, YeYing.MAN_STAT.NLP)
      })
    },
    c = function(i) {
      e({
        method: "JSONP",
        url: YeYing.config.ikefu.server + YeYing.config.ikefu.manual.proxy,
        params: {
          code: 1,
          systemId: YeYing.config.systemId,
          "internal.baiduhi": t.baiduAccount,
          callback: "JSON_CALLBACK"
        },
        timeout: 4e3
      }).success(function(e) {
        if ("success" === e.status) {
          {
            e.questionId
          }
          n.setState(YeYing.STATE_TYPE.MANUAL, YeYing.MAN_STAT.WAIT), e.reason = "你目前处于人工客服模式，请等待客服处理", i("success", e)
        } else e.reason.indexOf("offline") >= 0 ? (n.setState(YeYing.STATE_TYPE.BRIDGE_MODE, YeYing.BRIDGE_MODE.OFFLINE_MESSAGE), i("offlineMsg", e)) : i("failed", e)
      }).error(function() {})
    },
    u = function(i) {
      e({
        method: "JSONP",
        url: YeYing.config.ikefu.server + YeYing.config.ikefu.manual.proxy,
        params: {
          code: 13,
          systemId: YeYing.config.systemId,
          "internal.baiduhi": t.baiduAccount,
          callback: "JSON_CALLBACK"
        },
        timeout: 4e3
      }).success(function() {
        n.setState(YeYing.STATE_TYPE.MANUAL, YeYing.MAN_STAT.LEAVE_MESSAGE)
      }).error(function() {
        i("failed")
      })
    },
    a = function(i) {
      e({
        method: "JSONP",
        url: YeYing.config.ikefu.server + YeYing.config.ikefu.manual.proxy,
        params: {
          code: 2,
          systemId: YeYing.config.systemId,
          callback: "JSON_CALLBACK"
        },
        timeout: 4e3
      }).success(function(e) {
        "success" === e.status && (n.setState(YeYing.STATE_TYPE.MANUAL, YeYing.MAN_STAT.NLP), i())
      }).error(function() {})
    },
    o = function(n, i) {
      e({
        method: "JSONP",
        url: YeYing.config.ikefu.server + YeYing.config.ikefu.manual.proxy,
        params: {
          code: 3,
          systemId: YeYing.config.systemId,
          value: n,
          callback: "JSON_CALLBACK"
        },
        timeout: 4e3
      }).success(function(e) {
        "success" === e.status && i()
      }).error(function() {})
    };
  return {
    checkStatus: s,
    enterManual: c,
    backToNlp: a,
    sendEstimate: o,
    enterOffline: u
  }
}]);; /*!/js/service/message.js*/
"use strict";
var MSG = {};
MSG.DISPLAY_TYPE = {
  COVERT: 0,
  TIP: 1,
  ESTIMATE: 2,
  SUGGEST: 3
}, MSG.MSG_TYPE = {
  TEXT: 1,
  A: 2,
  IMG: 3,
  EMOTION: 4,
  EVENT: 5,
  ESTIMATE: 6,
  QUESTION: 7,
  SUGGEST: 8,
  RECOMMEND: 9,
  LINE: 10,
  PREDICT: 11
};
var manLocalSt = {
  doNothing: 0,
  toManual: 1,
  toNlp: 2
};
angular.module("yeying.web.service").service("WebMsgService", ["WebCommonService", "WebManualService", "MsgEmotion", "WebSdkService", "StateCenter", function(e, t, n, s) {
  var r = function(e, t) {
      return {
        href: e,
        label: t
      }
    },
    a = new RegExp("^\\[自动回复\\][一-龥]*退出人工"),
    i = new RegExp("^\\[自动回复\\].*"),
    l = new RegExp("^\\[系统提示\\].*"),
    o = new RegExp(".*msgOperate.estimate.*"),
    c = function(e) {
      for (var t = [], n = JSON.parse(e), s = 0; s < n.length; s++) switch (n[s].type) {
        case "TEXT":
          t.push({
            msgType: MSG.MSG_TYPE.TEXT,
            content: n[s].content
          });
          break;
        case "A":
          t.push({
            msgType: MSG.MSG_TYPE.A,
            content: n[s].content,
            url: n[s].url
          });
          break;
        case "PREDICT_QUESTION":
          t.push({
            msgType: MSG.MSG_TYPE.PREDICT,
            content: n[s].content
          });
          break;
        case "QUESTION":
          t.push({
            msgType: MSG.MSG_TYPE.RECOMMEND,
            content: n[s].content
          });
          break;
        case "IMG":
          t.push({
            msgType: MSG.MSG_TYPE.IMG,
            url: n[s].url
          });
          break;
        case "LINE":
          t.push({
            msgType: MSG.MSG_TYPE.LINE
          })
      }
      return t
    },
    u = function(e) {
      switch (e.mType) {
        case "text":
          var t = -1;
          return a.test(e.c) && (t = -1), {
            cnt: YeYing.util.encodeHTML(e.c),
            st: t,
            isText: !0
          };
        case "a":
          if (YeYing.util.startWith(e.href, "event")) {
            if (YeYing.util.startWith(e.href, "event:questionAnswer")) return {
              detail: {
                msgType: MSG.MSG_TYPE.QUESTION,
                content: e.label,
                url: e.href
              },
              cnt: "#*#*#*#",
              st: -1
            };
            if (YeYing.util.startWith(e.href, "event:estimate")) return {
              estimateContent: new r(e.href, e.label),
              hasEs: !0,
              cnt: "#*#*#*#",
              st: 0
            };
            if (YeYing.util.startWith(e.href, "event:nlpAnswerFeecback")) {
              var n = "",
                s = "",
                i = "";
              return YeYing.util.endWith(e.href, "up") ? (n = YeYing.config.nlpFeedbackUpImg, s = "nlp-feedback-up", i = "up") : YeYing.util.endWith(e.href, "down") && (n = YeYing.config.nlpFeedbackDownImg, s = "nlp-feedback-down", i = "none"), {
                detail: {
                  content: e.label,
                  url: e.href,
                  clickTime: 0,
                  imgUrl: n,
                  imgClass: s,
                  type: i
                },
                cnt: "",
                st: -1,
                showNlpFeedback: !0
              }
            }
            return YeYing.util.startWith(e.href, "event:chatStart") ? {
              cnt: "",
              st: 1
            } : YeYing.util.startWith(e.href, "event:backToNlp") ? {
              cnt: "",
              st: -1,
              showBack: !0
            } : YeYing.util.startWith(e.href, "event:manual") ? {
              cnt: "",
              st: 0
            } : YeYing.util.startWith(e.href, "event:questionClose") ? {
              cnt: "",
              st: 0,
              hasQuestionClose: !0
            } : YeYing.util.startWith(e.href, "event:SYSTEM_NOTICE") ? {
              detail: {
                msgType: MSG.MSG_TYPE.TEXT,
                content: e.label
              },
              cnt: "",
              st: -1,
              systemNotice: !0
            } : YeYing.util.startWith(e.href, "event:NLP_ANSWER") ? {
              detail: c(e.label),
              cnt: "",
              st: -1,
              nlpAnswer: !0
            } : YeYing.util.startWith(e.href, "event:NLP_PREDICT") ? {
              detail: c(e.label),
              cnt: "",
              st: -1,
              nlpPredict: !0
            } : {
              cnt: "",
              st: -1
            }
          }
          return {
            detail: {
              msgType: MSG.MSG_TYPE.EVENT,
              content: e.label,
              url: e.href
            },
            cnt: "#*#*#*#",
            st: -1
          };
        case "url":
          return {
            cnt: e.c,
            st: -1,
            isUrl: !0
          };
        case "face":
          return {
            detail: {
              msgType: MSG.MSG_TYPE.EMOTION,
              content: e.n
            },
            cnt: "#*#*#*#",
            st: -1
          };
        default:
          return {
            cnt: "",
            st: -1
          }
      }
    },
    g = function(t) {
      var n = 1 === t.way ? YeYing.context.userHeaderImg : YeYing.context.kefuHeaderImg,
        s = 1 === t.way ? "talk-a" : "talk-b",
        r = new Date(t.time),
        a = -1,
        g = !1,
        T = 1,
        h = 0,
        Y = [],
        p = [],
        f = [],
        S = {
          afterFeedback: !1,
          detail: []
        },
        E = [],
        M = [],
        d = [],
        m = !1,
        v = !1,
        G = t.type,
        y = t.msgbody;
      switch (G) {
        case 2:
          Y.push({
            msgType: MSG.MSG_TYPE.IMG,
            content: y.url,
            url: y.url
          });
          break;
        default:
          for (var k = 0; k < y.length; k++) {
            var I = u(y[k]),
              b = I.cnt;
            if (I.st >= 0 && (a = I.st, 1 === I.st && (p = c(YeYing.config.personal.systemMsg.kefuWelcome))), I.showBack && (T = 2), I.hasEs && (v = !0, d.push(I.estimateContent)), I.showNlpFeedback && S.detail.push(I.detail), I.systemNotice && (T = 0, p.push(I.detail)), I.nlpAnswer && (E = I.detail), I.nlpPredict && (M = I.detail), I.hasQuestionClose && (a = YeYing.MAN_STAT.NLP, m = !0), (i.test(b) || l.test(b) || o.test(b) || 1 === a) && 1 === T && (T = 0), i.test(b) && (s = "talk-notice", b = b.replace(/^\[自动回复]/g, "")), l.test(b) && (s = "talk-notice", b = b.replace(/^\[系统提示]/g, ""), b = b.replace(/<br\/>/g, "")), I.isText && p.push({
                msgType: MSG.MSG_TYPE.TEXT,
                content: b
              }), I.isUrl && p.push({
                msgType: MSG.MSG_TYPE.A,
                content: b,
                url: b
              }), void 0 !== I.detail)
              if (I.nlpAnswer) {
                for (var P = I.detail, N = 0; N < P.length; N++) p.push(P[N]);
                void 0 !== I.detail[1] && "回复留言" === I.detail[1].content && (T = 0)
              } else I.detail.msgType === MSG.MSG_TYPE.ESTIMATE && (h = MSG.DISPLAY_TYPE.ESTIMATE, T = 0), p.push(I.detail)
          }
          0 === p.length && (g = !0), b === YeYing.util.ignoreMsg && (g = !0);
          for (var k = 0; k < p.length; k++) Y.push(p[k])
      }
      var w = YeYing.context.initTime - r >= YeYing.config.historyThreshold;
      return w && (a = -1, g = !0), {
        time: e.getDateShowStringByTime(t.time),
        cite: r,
        role: s,
        type: h,
        headImg: n,
        manStatus: a,
        detail: Y,
        relatedQuestion: f,
        nlpFeedback: S,
        nlpPredictList: M,
        manualTo: T,
        ignore: g,
        hasEs: v,
        estimateContents: d,
        closeHeadNotice: m
      }
    },
    T = function(e, t) {
      s.sendMsg(e, function(e) {
        if ("ok" === e.result) {
          var n = g(e.content);
          t && t("success", n)
        } else if ("userMessage" === e.result) {
          if (t) {
            var s = Y("user", e.content);
            t("success", s)
          }
        } else if ("noticeMessage" === e.result) {
          if (t) {
            var s = Y("notice", e.content);
            t("success", s)
          }
        } else "TOO_FREQUENT" === e.errorMessage ? t("failed", YeYing.config.errorFrequent) : "REQUEST_ERROR" === e.errorMessage ? t("failed", YeYing.config.errorTooLong) : t("failed", e.errorMessage)
      })
    },
    h = function(e, t) {
      s.sendImgMsg(e, function(e) {
        if ("ok" === e.result) {
          var n = g(e.content);
          t ? t("success", n) : t("failed", e.errorMessage)
        } else t("failed", e.errorMessage)
      })
    },
    Y = function(t, n, s, r) {
      var a;
      "undefined" == typeof s && (s = 1);
      var i = [],
        l = {};
      l.msgType = 1, l.content = n, i.push(l), "undefined" == typeof r && (r = (new Date).toString());
      var o = null;
      return "user" === t ? (o = YeYing.context.userHeaderImg, a = "talk-a") : "service" === t ? (o = YeYing.context.kefuHeaderImg, a = "talk-b") : "notice" === t && (i = [], i.push({
        msgType: MSG.MSG_TYPE.TEXT,
        content: n
      }), a = "talk-notice"), {
        type: t,
        role: a,
        manualTo: s,
        headImg: o,
        detail: i,
        hasBackToNlp: !1,
        hasEs: !1,
        time: e.getDateShowStringByTime(r),
        hasQuestionClose: !1
      }
    },
    p = function(t, n, s, r) {
      for (var a, i = [], l = 0; l < n.length; l++) {
        var o = n[l];
        if ("text" === o.type) {
          var c = {};
          c.msgType = MSG.MSG_TYPE.TEXT, c.content = o.value, i.push(c)
        } else {
          var c = {};
          c.msgType = MSG.MSG_TYPE.A, c.url = o.href, c.content = o.label, i.push(c)
        }
      }
      "undefined" == typeof r && (r = (new Date).toString());
      var u = null;
      return "user" === t ? (a = "talk-a", u = YeYing.context.userHeaderImg) : "service" === t ? (a = "talk-b", u = YeYing.context.kefuHeaderImg) : "notice" === t && (a = "talk-notice"), {
        type: t,
        role: a,
        headImg: u,
        detail: i,
        hasBackToNlp: !1,
        hasEs: !1,
        time: e.getDateShowStringByTime(r),
        hasQuestionClose: !1
      }
    },
    f = function(t) {
      return {
        type: "service",
        role: "talk-b",
        headImg: YeYing.context.kefuHeaderImg,
        detail: c(t),
        hasBackToNlp: !1,
        hasEs: !1,
        time: e.getDateShowStringByTime(new Date),
        hasQuestionClose: !1
      }
    },
    S = function(e, t) {
      T(e, t)
    };
  return {
    forgeServerMsg: Y,
    generateMsgBean: g,
    sendQuestionMsg: S,
    sendImgMsg: h,
    forgeServerHistoryMsg: p,
    forgeServerWelcomeMsg: f
  }
}]);; /*!/js/directive/uyeditor.js*/
"use strict";
angular.module("yeying.web.directive", ["angular-szn-autocomplete"]).directive("uyEditor", ["SuggestService", "StateCenter", "PictureService", function(e, t, n) {
  return {
    restrict: "EA",
    replace: !0,
    templateUrl: "uyEditor.html?v=123",
    controller: ["$scope", function() {}],
    link: function(a, r, i) {
      a.assiInput = "";
      var l = "ueditor/",
        c = YeYing.config.ikefu.server + YeYing.config.ikefu.ueUploadUrl,
        o = {
          UEDITOR_HOME_URL: l,
          imageActionName: "uploadimage",
          serverUrl: c,
          wordCount: !1,
          focus: !0,
          scaleEnabled: !1,
          enableAutoSave: !1,
          autoHeightEnabled: !1,
          elementPathEnabled: !1,
          pasteplain: !1,
          saveInterval: 1e9,
          initialFrameHeight: 80,
          toolbars: [
            ["simpleupload"]
          ]
        },
        s = UE.getEditor("manual-ueditor", o);
      a.ue = s, a.sendAble = !0;
      var g = a[i.uyEditor];
      g.setStateChangeCaller(function(e, t) {
        switch (e) {
          case YeYing.STATE_TYPE.MANUAL:
            var n = t > 0 ? 1 : 0,
              r = s.queryCommandState("pasteplain");
            n === r && s.execCommand("pasteplain"), a.activePic = t;
            break;
          case YeYing.STATE_TYPE.CHAT:
            t === YeYing.CHAT_STATUS.offline ? (s.setDisabled(), a.sendAble = !1) : s.setEnabled()
        }
      });
      var u = function(e) {
        var t = $.trim(e),
          a = t.match(/<img.*src\s*=\s*"(.+?)".*>/);
        if (null !== a) {
          var r = a[1],
            i = r.match(/data:image\/(.*?);base64,(.*?)$/);
          if (null !== i) {
            var l = function(e) {
              try {
                "string" == typeof e && (e = e.replace("JSON_CALLBACK(", ""), e = e.substr(0, e.length - 2), e = JSON.parse(e)), "SUCCESS" === e.state ? (r = e.url, g.sendImgMsg(r, function() {
                  s.execCommand("cleardoc")
                })) : g.sendError("图片发送失败，只支持2M以内的图片")
              } catch (t) {
                g.sendError("图片发送失败，请稍后重试")
              }
            };
            n.setCallBack(l), n.getPicHelper().sendImg(i[2])
          } else g.sendImgMsg(r, function() {
            s.execCommand("cleardoc")
          })
        } else g.sendTxtMsg(t.replace(/<[^>]+>/g, ""), function() {
          s.execCommand("cleardoc")
        });
        s.focus();
        var c = angular.element.Event("blur"),
          o = angular.element("#chatSuggest");
        o.val(""), o.trigger(c)
      };
      g.setSendMsgCaller(function(e) {
        u(e)
      });
      var d = function() {
        if (!s.hasContents() || s.getContentTxt() === YeYing.config.ueditPlaceholder) return void s.execCommand("cleardoc");
        YeYing.util.collectUserAction("INPUT_NEW_QUESTION");
        var e = s.getPlainTxt();
        u(e)
      };
      a.sendMsg = d, a.options = {
        searchMethod: "search",
        onSelect: "suggestOnSelect"
      }, a.search = function(t, n) {
        e.query(t, n)
      }, a.suggestOnSelect = function(e) {
        s.execCommand("cleardoc"), s.focus(), YeYing.util.collectUserAction("CLICK_SUGGESTION"), g.sendTxtMsg(e.value)
      }, s.addListener("focus", function() {
        var e = s.getContentTxt();
        e === YeYing.config.ueditPlaceholder && s.setContent("")
      }), s.addListener("blur", function() {
        var e = s.getContentTxt();
        t.getState(YeYing.STATE_TYPE.MANUAL) === YeYing.MAN_STAT.NLP && "" === $.trim(e) && s.setContent('<p style="color: #B9B9B9; font-size: 12px;">' + YeYing.config.ueditPlaceholder + "</p>");
        var n = angular.element("#chatSuggest"),
          a = angular.element.Event("blur");
        n.trigger(a)
      }), a.sendActive = "", s.addListener("keyup", function(e, t) {
        t = window.event || t;
        var n = t.keyCode || t.which;
        if (a.sendActive = "" === $.trim(s.getContent()) ? "" : "active", (13 === n && t.ctrlKey || 13 === n && t.shiftKey) && s.execCommand("insertparagraph"), !a.activePic) {
          var r = s.getContentTxt(),
            i = angular.element.Event("keydown");
          13 !== n && 27 !== n && 38 !== n && 40 !== n && (i = angular.element.Event("input")), i.keyCode = n;
          var l = angular.element("#chatSuggest");
          l.val(r), l.trigger(i)
        }
        13 !== n || t.ctrlKey || d()
      })
    }
  }
}]);; /*!/js/directive/chat.record.js*/
"use strict";
angular.module("yeying.web.directive").directive("conversationMsg", [function() {
  return {
    restrict: "A",
    scope: {
      items: "="
    },
    template: '            <div ng-repeat="record in items">                <div ng-if="record.role == \'talk-b\'">                     <div service-record record="record" > </div>                 </div>                 <div ng-if="record.role == \'talk-a\'">                     <div user-record record="record" "> </div>                 </div>                 <div ng-if="record.role == \'talk-notice\'">                     <div system-notice record="record"> </div>                 </div>             </div>'
  }
}]).directive("msgContent", ["$compile", "MsgEmotion", function(e, t) {
  var c = function(e) {
      var c = e,
        i = [],
        r = 0;
      for (var a in c)
        if (c.hasOwnProperty(a)) {
          var s = c[a];
          switch (s.msgType) {
            case MSG.MSG_TYPE.TEXT:
              i.push(s.content.replace(/\n/g, "<br>"));
              break;
            case MSG.MSG_TYPE.A:
              var n = '<a href="' + s.url + '" target="_blank">' + s.content + "</a>";
              i.push(n);
              break;
            case MSG.MSG_TYPE.EVENT:
            case MSG.MSG_TYPE.QUESTION:
              i.push(s.content);
              break;
            case MSG.MSG_TYPE.SUGGEST:
              i.push(s.content);
              var d = s.suggests;
              d.forEach(function(e, t) {
                var c = t + 1,
                  r = '<a href="#" ng-click="msgOperate.clickSuggest(\'' + e + '\')" class="question">' + e + "</a>";
                i.push("<br>" + c + "." + r)
              });
              break;
            case MSG.MSG_TYPE.EMOTION:
              var l = t.replaceContentWithEmotion(s.content);
              i.push(l);
              break;
            case MSG.MSG_TYPE.IMG:
              var o = '<img ng-controller="MsgCtrl" ng-click="msgOperate.imageClick(\'' + s.url + '\')" class="pic-img" src="' + s.url + '">';
              i.push(o);
              break;
            case MSG.MSG_TYPE.ESTIMATE:
              var v = '<br><a href="#" ng-click="msgOperate.estimate(\'' + s.url + "')\">" + s.content + "</a>";
              i.push(v);
              break;
            case MSG.MSG_TYPE.LINE:
              var g = '<div class="message-txt-line"></div>';
              i.push(g);
              break;
            case MSG.MSG_TYPE.RECOMMEND:
              var p = s.content,
                m = '<div><a href="#" ng-click="msgOperate.clickSuggest(\'' + p + '\')" class="question">' + ++r + "." + p + "</a></div>";
              i.push(m);
              break;
            case MSG.MSG_TYPE.PREDICT:
              var p = s.content,
                m = '<div class="predict-question"><a href="#" ng-click="msgOperate.sendPredictQuestionMsg(\'' + p + '\')" class="question">' + p + "</a></div>";
              i.push(m)
          }
        } var k = '<div ng-controller="MsgCtrl" class="msg-cnt">' + i.join("") + "</div>";
      return k
    },
    i = function(t, i) {
      i.html(c(t.detail)).show(), e(i.contents())(t)
    };
  return {
    restrict: "A",
    link: i,
    replace: !0,
    scope: {
      detail: "="
    }
  }
}]).directive("msgFeedback", [function() {
  return {
    restrict: "A",
    template: '            <div ng-controller="MsgCtrl" ng-if="nlpFeedback.detail.length > 0" class="message-related-item" >                <div class="nlp-feedback-thanks" ng-if="nlpFeedback.afterFeedback">感谢您的反馈!</div>                <div ng-if="!nlpFeedback.afterFeedback">                    <h5 class="message-related-tt">是否解决了您的问题:</h5>                    <ul class="message-related-cc">                        <li ng-repeat="d in nlpFeedback.detail" ng-click="msgOperate.sendNlpFeedBack(d, nlpFeedback)"                         class="item">                             <span class="nlp-feedback-item">                                <img ng-src="{{d.imgUrl}}" class="{{d.imgClass}} nlp-feedback-ico">                                <i class="nlp-feedback-txt">{{d.content}}</i>                            </span>                        </li>                    </ul>                </div>            </div>',
    replace: !1,
    scope: {
      nlpFeedback: "="
    }
  }
}]).directive("serviceRecord", [function() {
  return {
    restrict: "A",
    replace: !0,
    scope: {
      record: "="
    },
    template: '            <div class="talk-item talk-b" >                  <div class="talk-item-time">                    {{record.time}}                </div>                <div class="talk-item-container">                    <div class="talk-item-content">                        <img class="head-photo" ng-src="{{record.headImg}}">                        <div class="message-text">                            <div msg-content detail="record.detail" ></div>                            <div msg-feedback nlp-feedback="record.nlpFeedback" ></div>                            <div ng-if="record.nlpPredictList.length > 0" msg-content detail="record.nlpPredictList"                                 class="msg-nlp-predict" ></div>                        </div>                    </div>                </div>            </div>'
  }
}]).directive("userRecord", [function() {
  return {
    restrict: "A",
    scope: {
      record: "="
    },
    template: '            <div class="talk-item talk-a">                <div class="talk-item-time">                    {{record.time}}                </div>                <div class="talk-item-container">                    <div class="talk-item-content">                        <img class="head-photo" ng-src="{{record.headImg}}">                        <div class="message-text">                            <div msg-content detail="record.detail" ></div>                            <div msg-feedback nlp-feedback="record.nlpFeedback" ></div>                            <div ng-if="record.nlpPredictList.length > 0" msg-content detail="record.nlpPredictList"                                 class="msg-nlp-predict" ></div>                        </div>                    </div>                </div>            </div>'
  }
}]).directive("systemNotice", [function() {
  return {
    restrict: "AE",
    scope: {
      record: "="
    },
    template: '                <div ng-controller="MsgCtrl" class="talk-item talk-notice"                 ng-if="record.tipContent.tip || record.detail[0].content">                    <span class="talk-notice-content">                        {{record.detail[0].content}}{{record.tipContent.tip}}                        <a ng-if="record.tipContent.entry" href="#" ng-click="manualTo(record.manualTo)">                        {{record.tipContent.entry}}</a>                    </span>                </div>'
  }
}]);; /*!/js/service/configuration.js*/
"use strict";
angular.module("yeying.web.service").service("WebConfigService", ["$http", "$q", "$timeout", function(e, o, n) {
  var i = {
      jsConf: {
        hiAccount: "YeYing.config.hiAcount = '$hiAccount$';",
        systemId: "YeYing.config.systemId = $systemId$;",
        mode: "YeYing.config.mode = $mode$;",
        historyInitCount: "YeYing.config.historyInitCount = $historyInitCount$;",
        checkQueueInterval: "YeYing.config.checkQueueInterval = $checkQueueInterval$;",
        favicon: "YeYing.config.favicon = '$favicon$';",
        systemType: "YeYing.config.systemType = $systemType$;",
        kefuImg: "YeYing.config.kefuHeaderImg = '$kefuImg$';",
        nlpImg: "YeYing.config.nlpHeaderImg = '$nlpImg$';",
        estimateType: "YeYing.config.estimateType = $estimateType$;",
        useOffline: "YeYing.config.useOffline = $useOffline$;"
      },
      msgConf: {
        nlpWelcome: "YeYing.config.personal.systemMsg.nlpWelcome = '$nlpWelcome$';",
        kefuWelcome: "YeYing.config.personal.systemMsg.kefuWelcome = '$kefuWelcome$';",
        robotName: "YeYing.config.robotName = '$robotName$';",
        systemTitle: "YeYing.config.systemTitle = '$systemTitle$';",
        systemInfo: "YeYing.config.systemInfo = '$systemInfo$';",
        ueditPlaceholder: "YeYing.config.ueditPlaceholder = '$ueditPlaceholder$';",
        hotQuestion: "YeYing.config.hotQuestion = $hotQuestion$;"
      },
      cssConf: {
        mainColor: ".web-main-header, .ueditor-send-con .btn-send,.ueditor-send-con .btn-send:hover, .talk-a .message-text,.estimate-title {background-color:$mainColor$;} .talk-a .message-text, .estimate-con .estimate-active {border-color:$mainColor$;} .talk-a .message-text:before, .talk-a .message-text:after {border-left: 9px solid $mainColor$;} .estimate-con .estimate-active {color: $mainColor$;}",
        linkColor: ".talk-b a, .talk-b a:visited, .talk-b a:hover, .talk-b li a, .talk-b li a:visited {color: $linkColor$;}"
      },
      imgConf: {
        headerLogo: '.web-header-logo {background: ($headerLogo$) no-repeat;background-size: cover;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=$headerLogo$, sizingMethod="scale");background-image: none\\0;}',
        bodyImage: '.web-wrapper {background: url($bodyImage$) no-repeat; background-size: cover;filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=$bodyImage$, sizingMethod="scale");background-image: none\\0;}'
      }
    },
    t = {
      jsConf: {},
      msgConf: {},
      cssConf: {},
      imgConf: {}
    };
  return YeYing.ConfigurationPrototype.call(this, "PC", i, t, e, o, n)
}]);; /*!/js/common/config/config.sys.js*/
var YeYing = YeYing || {};
YeYing.config = YeYing.config || {}, YeYing.config.hiAcountCt = "v", YeYing.config.hiPspJumpUrl = "//ikefu.baidu.com/nuomi/v3Jump.html", YeYing.config.errpage = "//ikefu.baidu.com/error.html", YeYing.MODE = {
  ALL: 1,
  ROBOT: 2,
  Manual: 3,
  None: 4
}, YeYing.config.mode = YeYing.MODE.ALL, YeYing.SYSTEMTYPE = {
  INTERNAL: 0,
  EXTERNAL: 1
}, YeYing.config.systemType = YeYing.SYSTEMTYPE.EXTERNAL, YeYing.config.noAnswer = "抱歉，系统暂时没有匹配到相关答案，请你完整描述你的问题", YeYing.config.offlineMessage = "您已经离线，若要对话请您刷新页面哦", YeYing.config.repeatLogin = "您已在其他地方登陆，若要对话请您刷新页面哦", YeYing.config.ikefu = {
  server: window.location.protocol + "//ikefu.baidu.com/",
  hiPspJumpUrl: "web/v3Jump.html",
  suggest: "api/tagsuggest",
  picture: "upload/controller.jsp?action=uploadimage",
  ueUploadUrl: "upload/controller.jsp",
  configuration: "api/clientConfig",
  manual: {
    proxy: "api/proxy?ie=" + new Date,
    establishCode: 1,
    destroyCode: 2,
    estimateCode: 3,
    queueCode: 4,
    pusherCode: 5,
    hotCode: 7,
    hotTagCode: 9,
    hotInTagCode: 10,
    afficheCode: 11,
    authCode: 12,
    offlineMessage: 13,
    sendUserInfo: 14,
    vToken: null,
    status: "api/isonline"
  },
  anonymousToken: null,
  chatRecord: "api/proxy?ie=" + new Date + "&code=6",
  serverTime: "api/getHostTime",
  hotQuestionCount: 10,
  accessCtrl: "api/proxy?code=8"
}, YeYing.config.sessionTimeout = 5, YeYing.config.releateQCount = 3, YeYing.config.nlpFeedbackUpImg = "https://bos.nj.bpc.baidu.com/v1/nightpicture/upload/sdk/20160927/14749557305940692484e00e43d-ce38-4c45-9f82-a2dbd81adb75.png", YeYing.config.nlpFeedbackDownImg = "https://bos.nj.bpc.baidu.com/v1/nightpicture/upload/sdk/20160927/1474957582153030169fa498aef-8b81-46c9-8ba2-addc3b6cd431.png", YeYing.config.nlpFeedbackUpHoverImg = "https://bos.nj.bpc.baidu.com/v1/nightpicture/upload/sdk/20160929/1475140655027006138a70b172e-2a8b-441c-ab53-4ea08df910cf.png", YeYing.config.nlpFeedbackDownHoverImg = "https://bos.nj.bpc.baidu.com/v1/nightpicture/upload/sdk/20160929/1475141287450006870d8a9c4cc-aed2-48bf-b320-737dc557e26a.png", YeYing.config.estimateType = 3, YeYing.config.mainServer = "http://yunkefu.baidu.com/";; /*!/js/common/config/yeying.js*/
var YeYing = YeYing || {};
YeYing.util = {
  ignoreMsg: "5CA884E2947449ACB2B9DA3589467E92",
  display: function(e, n) {
    var t = document.querySelector("#tipDisplay");
    if (null === t || void 0 === t) {
      t = angular.element('<div id="tipDisplay" class="copy-tip-display">' + e + "</div>");
      var r = angular.element(document.querySelector("body"));
      r.append(t), n || (n = 1e3), setTimeout(function() {
        t.remove()
      }, n)
    } else angular.element(t).html(e)
  },
  collectUserAction: function(e) {
    document.cookie = "USERACTION=" + e + ";domain=baidu.com;path=/"
  },
  formatDate: function(e, n) {
    var t = {
        "M+": e.getMonth() + 1,
        "d+": e.getDate(),
        "h+": e.getHours(),
        "H+": e.getHours(),
        "m+": e.getMinutes(),
        "s+": e.getSeconds(),
        "q+": Math.floor((e.getMonth() + 3) / 3),
        S: e.getMilliseconds()
      },
      r = {
        0: "/u65e5",
        1: "/u4e00",
        2: "/u4e8c",
        3: "/u4e09",
        4: "/u56db",
        5: "/u4e94",
        6: "/u516d"
      };
    /(y+)/.test(n) && (n = n.replace(RegExp.$1, (e.getFullYear() + "").substr(4 - RegExp.$1.length))), /(E+)/.test(n) && (n = n.replace(RegExp.$1, (RegExp.$1.length > 1 ? RegExp.$1.length > 2 ? "/u661f/u671f" : "/u5468" : "") + r[e.getDay() + ""]));
    for (var o in t) new RegExp("(" + o + ")").test(n) && (n = n.replace(RegExp.$1, 1 === RegExp.$1.length ? t[o] : ("00" + t[o]).substr(("" + t[o]).length)));
    return n
  },
  encodeHTML: function(e) {
    return null == e ? "" : e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/'/g, "&quot;").replace(/'/g, "&apos;").replace(/\r\n/g, "<br/>").replace(/\r/g, "<br/>").replace(/\n/g, "<br/>")
  },
  startWith: function(e, n) {
    var t = new RegExp("^" + n);
    return t.test(e)
  },
  endWith: function(e, n) {
    var t = new RegExp(n + "$");
    return t.test(e)
  },
  isJson: function(e) {
    try {
      var n = JSON.parse(e);
      return "object" == typeof n ? !0 : !1
    } catch (t) {
      return !1
    }
  },
  transformRequest: function(e) {
    if (!angular.isObject(e)) return null == e ? "" : e.toString();
    var n = [];
    for (var t in e)
      if (e.hasOwnProperty(t)) {
        var r = e[t];
        n.push(encodeURIComponent(t) + "=" + encodeURIComponent(null == r ? "" : r))
      } var o = n.join("&").replace(/%20/g, "+");
    return o
  },
  extend: function(e, n, t) {
    for (var r in n) !n.hasOwnProperty(r) || e.hasOwnProperty(r) && !t || (e[r] = n[r])
  },
  browserInfo: {
    versions: function() {
      var e = navigator.userAgent;
      return {
        ios: !!e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
        android: e.indexOf("Android") > -1 || e.indexOf("Linux") > -1,
        iPhone: e.indexOf("iPhone") > -1,
        iPad: e.indexOf("iPad") > -1
      }
    }()
  },
  getBrowserPlatform: function() {
    return this.browserInfo.versions.ios || this.browserInfo.versions.iPhone || this.browserInfo.versions.iPad ? "ios" : "android"
  },
  isMobileClient: function() {
    return this.browserInfo.versions.ios || this.browserInfo.versions.iPhone || this.browserInfo.versions.iPad || this.browserInfo.versions.android ? !0 : !1
  },
  includeStyle: function(e, n) {
    if (!document.getElementById(n)) {
      var t = document.createElement("style");
      t.id = n, (document.getElementsByTagName("head")[0] || document.body).appendChild(t), t.styleSheet ? t.styleSheet.cssText = e : t.appendChild(document.createTextNode(e))
    }
  },
  includeJs: function(e, n) {
    if (!document.getElementById(n)) {
      var t = document.getElementById("configjs");
      void 0 !== t && null !== t && (t.text = e.replace(/\n/g, "<br>"))
    }
  },
  getParameter: function(e) {
    var n = new RegExp("(^|(&|\\?))" + e + "=([^(&|\\?)]*)((&|\\?)|$)", "i"),
      t = window.location.search.substr(1).match(n);
    return null != t ? unescape(t[3]) : null
  },
  getSysPrefix: function() {
    var e = YeYing.util.getParameter("token");
    if (void 0 === e || null === e || "" === e) {
      var n = window.location.pathname.split("/").pop();
      n.indexOf(".") < 0 && (e = n)
    }
    return e
  },
  getClientName: function() {
    var e = YeYing.config.client,
      n = YeYing.util.getParameter("client");
    return "string" == typeof n && (e = n), e
  },
  getUserInfo: function() {
    var e = window.location.search.substring(1),
      n = {},
      t = e.split("&");
    if (t.length > 0)
      for (var r = 0; r < t.length; r++) {
        var o = t[r].indexOf("=");
        if (o > 0) {
          var i = t[r].substring(0, o);
          "token" !== i && "" !== i && "firstQuery" !== i && (n[i] = decodeURIComponent(t[r].substring(o + 1)))
        }
      }
    return n
  },
  getFirstQueryInfo: function() {
    var e = new RegExp("(^|&)firstQuery=([^&]*)(&|$)", "i"),
      n = window.location.search.substr(1).match(e);
    return null != n ? decodeURIComponent(n[2]) : null
  },
  create: function(e) {
    var n = function() {};
    return n.prototype = e, new n
  }
};
